-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Boards: STM32H750B-DK: Introduce App in Ext Flash variant #97037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Boards: STM32H750B-DK: Introduce App in Ext Flash variant #97037
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JarmouniA I was wondering if snippets could be used instead of adding a target each time we need to introduce an ext_mem app. Did you look at this possibility ?
Just thinking out loud, maybe the combination with sysbuild doesn't work great.
Not sure what we would put in them, maybe an ext Flash-specific snippet, but then the internal Flash is not necessarily the same, its sector size... |
95ac7ff
to
573417e
Compare
The following west manifest projects have changed revision in this Pull Request:
Additional metadata changed:
⛔ DNM label due to: 1 project with PR revision and 1 project with metadata changes Note: This message is automatically posted and updated by the Manifest GitHub Action. |
00106a2
to
b26dafd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Though, I think we can get rid of the mcuboot overlay by using stm32h750b_dk
as the mcuboot target. This way, mcuboot is a usual zephyr application running on internal flash.
(Note also that zephyr,code-partition = &boot_partition;
is already defined in mcuboot app.overlay)
To do this, you probably need to add a sysbuild.cmake
file to the board, stating:
if(SB_CONFIG_BOOTLOADER_MCUBOOT)
set_target_properties(mcuboot PROPERTIES BOARD stm32h750b_dk/stm32h750xx)
endif()
and no mcuboot dependency anymore.
Can you have a try and report back (somehow I can't find any stm32h750b_dk here anymore to test it myself) ?
I already thought of that, but the MCUboot App build depends on info specified in ext_flash_app variant dts, an example is info about the slots There are potentially other interdependencies at the sysbuild level as well, I don't think it's a good idea to use different targets. |
It builds on my side. I'm just unable to test it. |
The MCUboot partitions (slot0, slot1...) are not relevant to the base variant, which is supposed to be used with a regular Zephyr app (MCUboot is not a regular app, it's a bootloader) in internal Flash & external Flash is used for storage or whatever,
So why would we put the MCUboot partitions in the common dtsi, and of what use would be the ext_flash_app variant in that case? |
We already have this case on other boards where "main" variant .dts provides slot0/slot1 on internal flash and this "main" variant could be used either as a "direct" zephyr application or chainloaded behind mcuboot. Difference here is that we need a variant to be able to specify different Also note that these boards (based on h750, h7r/s) are a bit specific in the way that they have a quite limited internal flash and are meant to be used with a ext_flash, from which the main application should run. Last point about interest of the ext_flash_app variant is that it could be used to specify configurations that would not be supported on the main variant running on the internal flash (thinking about video use cases for instance). But I need to verify this point. |
It could definitely be used that way in a product where app upgrade is not needed by just relocating the big/non-critical parts of the app, running from internal Flash, to ext Flash. |
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
slot0_partition: partition@0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work in RAM_LOAD mode, build system considers the slot address as the user app's hex address (where image will be flashed), which is actually at an offset of 0x90000000.
Line 151 in 8c13c07
set(imgtool_args ${imgtool_args} --hex-addr ${slot0_partition_address}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try with CONFIG_XIP=n
? (required when RAM_LOAD is used)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done by sysbuild
set_config_bool(${ZCMAKE_APPLICATION} CONFIG_XIP n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be fixed by #97413
b26dafd
to
00e6e32
Compare
1b338a1
to
7d7cc0d
Compare
So actually, I've found another reason to keep your proposal is that whatever we propose for ext flash should also be compatible with use of chainloaded application from internal flash (when it applies, ie on SoC with internal flash big enough to support this case). Ie, we should support the following:
So my proposal wouldn't work. |
7d7cc0d
to
7be53c6
Compare
Pull in the necessary MCUboot bits, will be removed before merging the PR. Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
Introduce a board variant for storing an app in external QSPI NOR Flash and chainloading it with MCUboot (placed in internal Flash) to be executed in place (XiP) (set by default, MCUBOOT_MODE_DIRECT_XIP). The new variant requires a board DT overlay on the MCUboot side to set the internal Flash & Flash controller as the chosen 'zephyr,flash' & 'zephyr,flash-controller'. Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
Add stm32h750b_dk/stm32h750xx/ext_flash_app target to CI platforms Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
Add stm32h750b_dk/stm32h750xx/ext_flash_app target to CI platforms. Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
7be53c6
to
0cf7d9d
Compare
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
Introduce a board variant for storing an app in external QSPI NOR Flash and chainloading it with MCUboot (which is placed in internal Flash) to be executed in place (XiP) (MCUBOOT_MODE_DIRECT_XIP, set by default in board's
Kconfig.sysbuild
).The ext Flash memory partition also allows for using the Swap-using-offset & swap-using-move MCUboot image upgrade algorithms, eventhough it's not optimal as it has same-sized slots.
The new variant requires a board DT overlay on the MCUboot side (mcu-tools/mcuboot#2479) to set the internal Flash & Flash controller as the chosen 'zephyr,flash' & 'zephyr,flash-controller'. This way, no overlay will be needed at the Zephyr user app level.